import Vue from 'vue'
import VueRouter from 'vue-router'

import Index from '../components/Index.vue'
import Home from '../components/Home.vue'
import Search from '../components/Search/Search.vue'
import Discover from '../components/Discover.vue'
import Albums from '../components/Albums.vue'
import Artists from '../components/Artists.vue'
import Recent from '../components/Recent.vue'
import Favourites from '../components/Favourites.vue'
import Local from '../components/Local.vue'
import Create from '../components/Create.vue'
import Collect from '../components/Collect.vue'
import Settings from '../components/Settings.vue'
import Login from '../components/Login.vue'
import Shopcat from '../components/Shopcat.vue'
import Pay from '../components/Pay.vue'
import Order from '../components/Order.vue'
import Introduction from '../components/Introduction.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Index,
    children: [
      { path: '/', redirect: '/home' },
      { path: '/index', redirect: '/home' },
      { path: '/home', name: 'home', component: Home },
      { path: '/search', name: 'Search', component: Search },
      { path: '/discover', name: 'Discover', component: Discover },
      { path: '/album', name: 'Albums', component: Albums },
      { path: '/artists', name: 'Artists', component: Artists },
      { path: '/recent', name: 'Recent', component: Recent },
      { path: '/favourites', name: 'Favourites', component: Favourites },
      { path: '/local', name: 'Local', component: Local },
      { path: '/create', name: 'Create', component: Create },
      { path: '/collect', name: 'Collect', component: Collect },
      { path: '/settings', name: 'Settings', component: Settings },
      { path: '/login', name: 'Login', component: Login },
      { path: '/shopcat', name: 'Shopcat', component: Shopcat },
      { path: '/pay', name: 'Pay', component: Pay },
      { path: '/order', name: 'Order', component: Order },
      { path: '/introduction', name: 'Introduction', component: Introduction }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
